<?php echo validation_errors(); ?>
   
<div class="contentcontainer" id="tabs">
    <div class="headings altheading">
        <h2 class="left">Role Managerment</h2>
        <ul class="smltabs">
            <li><a href="#tabs-1">Insert Role</a></li>
            <?php if($page_type == 'edit'): ?>
            <li><a href="#tabs-2">List Permission</a></li>
            <?php endif; ?>
        </ul>
    </div>
    <div class="contentbox" id="tabs-1">
        <?php 
            $attributes = array('id' => 'frm_insert_ar','onsubmit'=>'return Form.validateInsertRole(this)');
            print form_open($action,$attributes);
        ?>
            <p>
                <label for="textfield"><strong>Role Name:</strong></label>
                <input type="text" name="name" value="<?php print (isset($role)) ? $role['role_name'] : set_value('role_name'); ?>" id="role_id" class="inputbox required" > <br />
                <span class="role_id_required smltxt red" style="display: none;">loi ko de trong</span>
            </p>
            <p>
                <label for="textfield"><strong>Description:</strong></label>
                <input type="text" name="description" value="<?php print (isset($role)) ? $role['description'] : set_value('description'); ?>" id="description" class="inputbox required" > <br />
                <span class="description_required smltxt red" style="display: none;">phai dien day du</span>
            </p>

            <p>
                <label for="textfield"><strong>Can delete:</strong></label>
                <input type="radio" name="candelete" value="1" <?php print (isset($role) && $role['can_delete'] == 1 ) ? 'checked="checked"' : ''; ?> > Yes
                <input type="radio" name="candelete" value="0" <?php print (isset($role) && $role['can_delete'] == 0 || !isset($role) ) ? 'checked="checked"' : ''; ?> > No
            </p>
            <p>
                
            </p>
            <p><input type="submit" value="Submit" class="btn" ></p>
        </form>
    </div>
    <?php if($page_type == 'edit'): ?>
     <div class="contentbox nopad" id="tabs-2">
        <?php if(isset($datatablePermission_html)) print $datatablePermission_html; ?>
    </div>
    <?php endif;?>
</div>
 